home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20021006-20030409
/
000076_fdc@columbia.edu_Wed Nov 13 16:14:32 EST 2002.msg
< prev
next >
Wrap
Text File
|
2020-01-01
|
2KB
|
64 lines
Article: 13842 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!news.columbia.edu!news-not-for-mail
From: fdc@columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: C-Kermit FTP script
Date: 13 Nov 2002 16:14:24 -0500
Organization: Columbia University
Lines: 47
Message-ID: <aqufbg$f0l$1@watsol.cc.columbia.edu>
References: <8ce22d01.0211131301.2d2c8112@posting.google.com>
NNTP-Posting-Host: watsol.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1037222065 3270 128.59.39.139 (13 Nov 2002 21:14:25 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 13 Nov 2002 21:14:25 GMT
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13842
In article <8ce22d01.0211131301.2d2c8112@posting.google.com>,
Dan Skinner <JDanSkinner@JDanSkinner.com> wrote:
: ; FTP script from Linux archive to skinner /icsdemo
: set command quoting on
: set login prompt
: set network tcp/ip
: if fail end 1 TCP/IP Failed
: set input echo on
: ftp open skinner /user:root /password:xxxxxx
: if fail exit 1 connection failed
: ftp cd /icsdemo
: ftp put jdsmenuarch.tar
: ftp put gbsarch.tar
: quit
:
: The script above works when the ftp open is correct.
: if also works correctly (fails) if the ftp server does not exist.
: It is broken if the server exists but the login fails.
: IE: the put commands are issued.
: I've made it as simple as I can but can't see what I'm doing wrong.
: Using Linux 8.0.206 on Mandrake distro.
: Skinner is SCO OpenServer 5.04 if that matters?
:
No. By default (i.e. unless you have SET FTP AUTOLOGIN OFF),
the FTP OPEN command does two things: makes the connection and
logs you in (perhaps prompting you for your user ID or password).
Thus it can succeed in opening the connection but fail in attempting
to log you in. The FTP scripting tutorial explains this and shows
how to handle it:
http://www.columbia.edu/kermit/ftpscripts.html
Briefly:
ftp open somehost [ /user:xxx [ /password:yyy ] ]
if fail stop 1 FTP connection failed
if not \v(ftp_loggedin) stop 1 FTP login failed
...
You'll also need IF FAIL clauses after all your other FTP commands
if you don't want the script to keep executing after a failed command.
Who remembers SNOBOL? Kermit scripts are kind of like that: with
each statement, you should consider what should be done next if it
succeeds and what should be done if it fails.
- Frank